<?php
include 'all.php';
include '../head.php';
?>
<title>Profile | Child</title>

<body>
    <div id="wrapper">

        <?php include '../header_profile.php'; ?>
<?php include '../menu_left.php'; ?>
        <div class="salus_bank_reg float_left">


            <a class="float_left" href="">
                <!--                    <div class="salus_bank_logo logo"></div>-->
                <img src="../../include/images/logo_sakusbank.png" width="104px;" />
                <div class="down_arrow"></div>
            </a>
            <div class="clear"></div>

            <div class="float_left top_menu "><a href="#">PRINT</a></div>    


            <div class="clear"></div>

            <div class="clear"></div>




            <div id="mainContent">         
                <hr>
                <?php
                /*
                 * To change this template, choose Tools | Templates
                 * and open the template in the editor.
                 */
                ob_start();
                //include(dirname(__FILE__).'pf.php');
//    include '../../plugins/pdf/examples/res/child_profile.php';
                include '../print/child_profile.php';
                $content = ob_get_clean();
                $filename = rand(0, 10000) . '_' . $_COOKIE['gid'] . '.pdf';                
                $path = '/var/www/html/salusme/storage/temps/';
                //$path = '/home/salusban/www/salusbank.ch/salusme/storage/temps/';
                require_once '../../plugins/pdf/html2pdf.class.php';
                try {
                    $html2pdf = new HTML2PDF('P', 'A4', 'fr');
                    $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
                    $html2pdf->Output($path . $filename, 'F');



                    echo 'PDF Generated';
                } catch (HTML2PDF_exception $e) {
                    echo $e;
                    exit;
                }
                ?>
                <form action="<?= 'http://' . $_SERVER['HTTP_HOST'] . '/salusme/plugins/mail/mail1.php' ?>" method="post" >
                    <input type="hidden" name="filename" value="<?= $path . $filename ?>" />
                    <table>
                        <tr><td>To : </td><td><input type="text" name="to"  /></td></tr>
                        <tr><td>Subject : </td><td><input type="text" name="subject"  /></td></tr>
                        <tr><td>Message : </td><td><input type="text" name="message"  /></td></tr>                    
                    </table>
                    <input type="submit" value="Send" />
                </form>

            </div>

        </div><!-- wrapper over    -->
        <?php
        include '../../include/config.php';
        include '../menu_right.php';
        ?>
</body>
</html>
